#include "log.hpp"
#include "PthreadPool.hpp"
#include "task.hpp"
#include <memory>
using namespace PthreadPoolModule;
using namespace LogModule;
using namespace PthreadModlue;

int main()
{
   //ENABLE_CONSOLE_LOG_STRATEGY();
   ENABLE_FILE_LOG_STRATEGY();
    // ThreadPool<task_t> tp;
    // ThreadPool<task_t> tp1 = tp;
    // ThreadPool<task_t> *tp = new ThreadPool<task_t>();

    // tp->Start();
    // 有一个单例了! 如果线程池本身，会被多线程获取呢？？
    int count = 10;
    while (count)
    {
        sleep(1);
        PthreadPool<task_t>::GetInstance()->Enqueue(Download);
        count--;
    }

    PthreadPool<task_t>::GetInstance()->Stop();
    PthreadPool<task_t>::GetInstance()->Join();

   
    return 0;
}